﻿package mortal.game.view.mainUI.smallMap.view
{
    import com.mui.controls.*;
    import com.mui.utils.*;
    import flash.geom.*;
    import mortal.common.swfPlayer.*;
    import mortal.common.swfPlayer.data.*;
    import mortal.component.gconst.*;
    import mortal.game.scene3D.map3D.util.*;
    import mortal.game.scene3D.player.entity.*;
    import mortal.game.view.copy.petBreak.*;

    public class SmallMapPathShower extends GSprite
    {
        private var _swfSelf:SWFPlayer;
        private var _path:GSprite;

        public function SmallMapPathShower()
        {
            return;
        }// end function

        public function updateSelfPlace(param1:Number, param2:Number) : void
        {
            this._swfSelf.move(param1 - 2 + 206, param2 - 15 + 215);
            return;
        }// end function

        public function showHideSelfIcon(param1:Boolean) : void
        {
            this._swfSelf.visible = param1;
            return;
        }// end function

        public function showPath(param1:Array, param2:Number, param3:Number) : void
        {
            var _loc_8:Point = null;
            this.clearPaths();
            var _loc_4:* = PetBreakCopyUtil.player;
            this._path.graphics.lineStyle(2, 65280, 0.5);
            this._path.graphics.moveTo(_loc_4.x2d * param2, _loc_4.y2d * param3);
            var _loc_5:* = param2 * GameMapUtil.tileWidth;
            var _loc_6:* = param3 * GameMapUtil.tileHeight;
            var _loc_7:int = 0;
            while (_loc_7 < param1.length)
            {
                
                _loc_8 = param1[_loc_7];
                this._path.graphics.lineTo((_loc_8.x + 0.5) * _loc_5, (_loc_8.y + 0.5) * _loc_6);
                _loc_7++;
            }
            return;
        }// end function

        public function clearPaths() : void
        {
            this._path.graphics.clear();
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._path = UICompomentPool.getUICompoment(GSprite);
            this._path.filters = [FilterConst.buttonGlowFilter];
            this.addChild(this._path);
            this._swfSelf = UICompomentPool.getUICompoment(SWFPlayer) as SWFPlayer;
            this._swfSelf.load("smallMapSelf.swf", ModelType.NormalSwf, null);
            this.addChild(this._swfSelf);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._path.graphics.clear();
            this._path.dispose(param1);
            this._path = null;
            this._swfSelf.dispose(param1);
            this._swfSelf = null;
            return;
        }// end function

    }
}
